const fs = require("fs");
const path = require("path");

const avatarDir = path.resolve(__dirname, "../public/static/avatar");

module.exports = async () => {
    const files = await fs.promises.readdir(avatarDir);
    const index = Math.floor(Math.random() * files.length);
    return "/static/avatar/" + files[index];
}
